package collection;

import java.util.ArrayList;
import java.util.List;

public class SubListDemo {
    public static void main(String[] args) {
        List<Integer> l = new ArrayList<>();
        for (int i = 0;i<10;i++){
            l.add(i*6);
        }
        System.out.println(l);

        List<Integer> z = l.subList(2,6);
        System.out.println(z);

        for (int i= 0;i<z.size();i++){
            z.set(i, z.get(i)*10);
        }
        System.out.println(z);
        System.out.println(l);

        l.set(2,66);
        System.out.println(l);
        System.out.println(z);

        l.remove(6);
        System.out.println(l);

    }
}
